package org.test.cxf.ws.imp;

import org.test.cxf.domain.Cat;
import org.test.cxf.domain.User;
import org.test.cxf.ws.UserService;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class UserServiceImpl implements UserService {

    static Map<User, List<Cat>> catDb = new HashMap<>();

    static {
        List<Cat> list = new ArrayList<>();
        Cat cat1 = new Cat(1,"小猫1","红色");
        Cat cat2 = new Cat(2,"小猫2","黄色");
        list.add(cat1);
        list.add(cat2);

        User user = new User();
        user.setId(1);
        user.setName("夏国杰");
        user.setPass("3322");
        catDb.put(user, list);

    }
    public List<Cat> getCatByUser(User user) {
        return catDb.get(user);
    };
}
